package fact;

import java.lang.reflect.Array;

class Any<T extends Comparable<T>> {
    //Object[] obj=new Object[3];
    public T[]array;

    public Any() {
    }
    public Any(Class<T>tClass,int capcity) {
        array=(T[])Array.newInstance(tClass,capcity);
    }
    public T getpos(int pos) {
        return (T)array[pos];
    }
    public void setpos(int pos,T val) {
        array[pos]=val;
    }

    public T[] Getarray() {
        return array;
    }
}
public class Text {
    public static void main(String[] args) {
        Any<Integer> any = new Any<>(Integer.class,10);
        any.setpos(0,1);
        any.setpos(1,55);
        any.setpos(2,67);
        Integer[] array=any.Getarray();
        System.out.println(array[1]);
    }
}
